feat(examples): add wa-sqlite OPFS persistence demo#1329
feat(examples): add wa-sqlite OPFS persistence demo#1329
Conversation
|
More templates
@tanstack/angular-db
@tanstack/db
@tanstack/db-browser-wa-sqlite-persisted-collection
@tanstack/db-ivm
@tanstack/db-react-native-sqlite-persisted-collection
@tanstack/db-sqlite-persisted-collection-core
@tanstack/electric-db-collection
@tanstack/offline-transactions
@tanstack/powersync-db-collection
@tanstack/query-db-collection
@tanstack/react-db
@tanstack/rxdb-db-collection
@tanstack/solid-db
@tanstack/svelte-db
@tanstack/trailbase-db-collection
@tanstack/vue-db
commit: |
|
Size Change: 0 B Total Size: 110 kB ℹ️ View Unchanged
|
|
Size Change: 0 B Total Size: 4.23 kB ℹ️ View Unchanged
|
490d519 to
d7a150d
Compare
The infinite retry loop here might be related to #1065 |
37c3bf5 to
ca46819
Compare
dc17281 to
2841627
Compare
…ctions Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2455641 to
e22631a
Compare
|
GPT5.4 review: Findings
resolve: {
alias: {
// Resolve to source so Vite can process the ?worker import natively
'@tanstack/db-browser-wa-sqlite-persisted-collection': path.resolve(
__dirname,
`../../../packages/db-browser-wa-sqlite-persisted-collection/src/index.ts`,
),
},
},export { createBrowserWASQLitePersistence } from './browser-persistence'
export { openBrowserWASQLiteOPFSDatabase } from './opfs-database'
export { BrowserCollectionCoordinator } from './browser-coordinator'
export type { BrowserCollectionCoordinatorOptions } from './browser-coordinator'
export { persistedCollectionOptions } from '@tanstack/db-sqlite-persisted-collection-core'AssumptionsThe PR body for #1329 already has “Replace the workspace dependencies...” unchecked, so this may be known. I’m still calling it out because it is a real blocker today, not just cleanup. Residual RiskI didn’t count the existing SPA/API example breakage against this PR since the author already called that out and it predates these changes. I also didn’t do browser smoke testing after finding the build blocker. |
The browser wa-sqlite package source re-exports from the core package, so resolving from source requires both aliases for the build to succeed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@kevin-dp maybe for a different PR, but the current (including in |
Hi @AntonOfTheWoods, i'd prefer fixing that in a separate PR and keep this one focused. |
|
Ok. I tried running it and was a little surprised to see it doesn't even build. The code depends on methods that haven't existed for months in dependencies... |
143cf97 to
6a9d96d
Compare
|
@samwillis I addressed your review in 515fc6c. Vite now builds the app. Typescript is emitting some errors though but this predates this PR and is also the case in main. Something to fix in a follow up PR. |
Summary
@tanstack/db,db-sqlite-persisted-collection-core,query-db-collection, andelectric-db-collectionTest plan
pnpm vitest --run packages/db/tests/collection.test.tspnpm --filter @tanstack/query-db-collection exec vitest run tests/query.test.ts --coverage.enabled falsepnpm --filter @tanstack/electric-db-collection exec vitest run tests/electric.test.ts --coverage.enabled falsepnpm --filter @tanstack/db-sqlite-persisted-collection-core exec vitest run tests/persisted.test.ts tests/sqlite-core-adapter.test.ts --coverage.enabled falseNotes
@standard-schema/specinsrc/persisted.tsafter the tests complete.